<?php if ($sf_user->hasFlash('saved_contents')){
?>		
			<div id="notification" class="nNote nSuccess hideit" onclick="$('#notification').hide('slow')" style="margin-top: 20px;">
                <p><strong>SUCCESS: </strong> <?php echo $sf_user->getFlash('saved_contents') ?></p>
         </div>

<?php 
}?>
<form action="<?php echo url_for("copy_contents/copyContents")?>" method="post" id="copy_contents_form">
<div class="widget" id="template_div">
        <div class="head"><h5 class="iList">Select Directory and Category</h5></div>
            <fieldset>
            
		     	<div class="rowElem noborder">
		     		<div class="formLeft">
							<select id="sl_master_directory" name="sl_master_directory" onchange="loadDirectoryCategory()">
							<option value="">
                    		--Select Directory--
                    		</option>                    	
                    		<?php 
                    		foreach($directories_with_content as $directory_id => $directory_name_categories){
                    		?>
                    		<option value="<?php echo $directory_id?>">
                    			<?php echo $directory_name_categories[0]?>
                    		</option>	
                    
                    		<?php }
                    		?>
                    	</select>		     		
		     		</div>
		     		 
		     		 <div id="sitemaps_info" style=" float: left; margin-left: 20px; ">
		     		 	<select>
							<option value="">
                    		--Select Category--
                    		</option>  		     		 	
		     		 	</select>
		     		 </div>
		     		 
		     		<div class="fix"></div>
		     		
		     		
		     	</div>            
 
            </fieldset>

</div>

<div id="empty_categories">
</div>





	</form>
<script>
function loadDirectoryCategory (){

	var php_url = '<?php echo url_for('copy_contents/getCategories?directory_id=')?>';
	var directory_id = document.getElementById('sl_master_directory').value;
	php_url = php_url.concat(directory_id);	

	if (directory_id != ""){
		$.ajax({type: 'POST', url:php_url, script:true, cache:false, 
			success: function(data) { 
				 $('#sitemaps_info').html(data);
				} });
	}else{
		$('#sitemaps_info').html("");
	}

	$('#empty_categories').html("");
	
}
</script>